package com.meituan.catering.management.shop.dao.mapper;
import java.util.List;

import com.meituan.catering.management.shop.dao.model.request.SearchShopDataRequest;
import org.apache.ibatis.annotations.Param;

import com.meituan.catering.management.shop.dao.model.ShopDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 门店对应的MyBatis Mapper
 * @author mac
 */
@Mapper
public interface ShopMapper {

    /**
     * 根据商户号查询门店
     * @param tenantId
     * @param userId
     * @param businessNo
     * @return
     */
    ShopDO findByBusinessNo(Long tenantId, Long userId, String businessNo);

    /**
     * 插入门店信息
     * @param shopDO
     * @return
     */
    int insert(ShopDO shopDO);

    /**
     * 根据ID获取门店信息
     * @param id
     * @return
     */
    ShopDO selectById(@Param("id") Long id);

    /**
     * 据条件查询总条数
     * @param pageDO
     * @return
     */
    int countAll(SearchShopDataRequest pageDO);

    /**
     *目标页码对象列表查询
     * @param pageDO
     * @return
     */
    List<ShopDO> searchAll(SearchShopDataRequest pageDO);

    /**
     * 更新门店信息
     * @param businessNo
     * @param version
     * @param shopDO
     * @return
     */
    int update(String businessNo, ShopDO shopDO);

    /**
     * 开启一家门点
     * @param businessNo
     * @param version
     * @param shopDO
     * @return
     */
    int open(String businessNo, ShopDO shopDO);

    /**
     * 关闭一家门店
     * @param businessNo
     * @param shopDO
     * @return
     */
    int close(String businessNo, ShopDO shopDO);
}
